import java.util.Scanner;

//牛牛的快递
//1kg以内 20元 不足1kg按1kg计算 超出每kg 1元  加急5元
public class test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        float a = scanner.nextFloat();
        String result = scanner.next();
        char b = result.charAt(0);
        int cost = 20;
        int flag = 0;

        if(b=='y'){
            //要加急
            if(a<=1){
                cost+=5;
            }else{
                if(a%1==0){
                    //没有小数点
                    flag = (int) a;
                    cost = cost+(flag-1)*1+5;
                }else{
                    //有小数点
                    flag = (int) a+1;
                    cost = cost+(flag-1)*1+5;
                }
            }
        } else if (b=='n') {
            //不加急
            if (a<=1){
                cost=cost;
            }else{
                if(a%1==0){
                    //没有小数点
                    flag = (int) a;
                    cost = cost+(flag-1)*1;
                }else{
                    //有小数点
                    flag = (int) a+1;
                    cost = cost+(flag-1)*1;
                }
            }
        }
        System.out.println(cost);
    }
}
